/**
 * @file complete_binary_tree.cpp
 * @author 逆流 (1171267147@qq.com)
 * @brief
 * @version 0.1
 * @date 2024-10-15
 *
 * @copyright Copyright (c) 2024
 *
 */

#include <gtest/gtest.h>

#include <iostream>

#include "stl/container/complete_binary_tree.hpp"

using stl::CompleteBinaryTree;

TEST(CompleteBinaryTree, Basic) {
    CompleteBinaryTree<int> tree;
    tree.Push(1);
    tree.Push(2);
    tree.Push(3);
    tree.Push(4);
    tree.Push(5);
    tree.Push(6);
    tree.Push(7);
    tree.Push(8);

    EXPECT_EQ(tree.size(), 8);

    std::function<void(int)> print = [](int data) {
        std::cout << data << " ";
    };

    tree.Preorder(print);
    std::cout << "\n";
    tree.Inorder(print);
    std::cout << "\n";
    tree.Postorder(print);
    std::cout << "\n";
}
